package com.zx.idc.backend.gui.slog;

import com.zx.idc.backend.gui.common.MongoBaseApi;
import com.zx.idc.backend.gui.common.Result;
import com.zx.idc.ds.common.mongopage.Page;
import com.zx.idc.ds.httplog.entity.FilterPageSnapshot;
import com.zx.idc.ds.httplog.service.IHttpLogFilterLogService;
import com.zx.idc.ds.httplog.vo.FilterLogVo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 过滤日志表 前端控制器
 * </p>
 *
 * @author chendong
 * @since 2019/4/8
 */
@RestController
@RequestMapping("/api/slogFilterLog")
public class SlogFilterLogController extends MongoBaseApi<IHttpLogFilterLogService, FilterLogVo> {

    @GetMapping("/query-page")
    @RequiresPermissions("regulatory-log:filter-log")
    public Result<Page<FilterLogVo>> page(Page<FilterLogVo> page, FilterLogVo filterLogVo) {
        return success(service.pageByParam(page, filterLogVo));
    }

    @GetMapping("/get/snapshot")
    @RequiresPermissions("regulatory-log:filter-log")
    public Result<FilterPageSnapshot> getSnapshot(FilterLogVo filterLogVo) {
        return success(service.getSnapshot(filterLogVo));
    }
}
